﻿using System.Web;

namespace CodeContrib.Web
{
	public class StatusCodeHttpHandler : IHttpHandler
	{
		private readonly int _statusCode;

		public bool IsReusable
		{
			get { return true; }
		}

		public StatusCodeHttpHandler(int statusCode)
		{
			_statusCode = statusCode;
		}

		public void ProcessRequest(HttpContext context)
		{
			context.Response.StatusCode = _statusCode;
		}
	}
}